﻿/*
 * Created by SharpDevelop.
 * User: StrunevskyDV
 * Date: 23.01.2010
 * Time: 16:09
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using EmailJabber.EmailJabber.Core.Entities;
using EmailJabber.Logic.Commands.Base;
using EmailJabber.Logic.Logic.BusinessLogic;

namespace EmailJabber.Logic.Commands
{
    /// <summary>
    /// Description of LogAllCommand.
    /// </summary>
    public class LogAllCommand:CommandBase
    {
       

        protected override string GetDecription()
        {
            return "Get all log entries";
        }

        protected override Guid GetId()
        {
            return new Guid("CF07DFE0-5A5A-470A-98E4-139F6D27BC6D");
        }


        protected override void ExecuteSafe(MessageIM comnd)
        {
            List<LogEntry> entries= DAL.DAL.Instance.GetAll();
            foreach(LogEntry logEntry in entries)
            {
            	
            	BL.Instance.Send(MessageIM.GetReply( "Time:" + logEntry.Time +Environment.NewLine + logEntry.Extra,comnd));
            }
        }
    }
}